#include <windows.h>

//分辨率
#define SCREEN_WIDTH 1920
#define SCREEN_HEIGHT 1080

//颜色
#define RED   0
#define GREEN 0
#define BLUE  0

HDC hdc;

int main( void )
{
	//定义中心点变量
	int CentreX,CentreY;
	
	//设置中心点变量的值
	if(SCREEN_WIDTH%2 == 0){
		CentreX = SCREEN_WIDTH / 2;
	}else{
		CentreX = SCREEN_WIDTH / 2 + 1;
	}
	if(SCREEN_HEIGHT%2 == 0){
		CentreY = SCREEN_HEIGHT / 2;
	}else{
		CentreY = SCREEN_HEIGHT / 2 + 1;
	}
	
	//绘制2*2个像素点的时候则中心放在2*2的右下角
	while(true){
		hdc = GetWindowDC(NULL);
		SetPixel(hdc, CentreX,		CentreY,	RGB(RED,GREEN,BLUE));
		SetPixel(hdc, CentreX - 1,	CentreY,	RGB(RED,GREEN,BLUE));
		SetPixel(hdc, CentreX,		CentreY - 1,RGB(RED,GREEN,BLUE));
		SetPixel(hdc, CentreX - 1,	CentreY - 1,RGB(RED,GREEN,BLUE));
		ReleaseDC(NULL, hdc);
		Sleep(10);
	}
	system("pause");
    return 0;
}

//编译指令 gcc FpsGamePoint.cpp -o FpsGamePoint.exe -lgdi32
